<#include "/common/layout.html">
<@header>
</@header>
<@body>
<div class="content-wrapper">
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <h1>
      <small>系统管理 > 部门管理</small>
    </h1>
  </section>
  <!-- Main content -->
  <section class="content">
    <!-- Your Page Content Here -->
    <div class="row">
      <div class="col-xs-12">
        <div class="box">
         <form action="/system/dept/list/1.html" method="post">
          <div class="box-header">
            <#if permissions?seq_contains('addDept')>
            <a class="btn btn-primary" href="/system/dept/add.html"><i class="fa fa-plus"></i> 创建部门</a>
            </#if>
            <div class="box-tools">
              <div class="input-group" style="width: 250px;">
                <input type="text" name="search" value="${search!}" class="form-control input-sm pull-right" placeholder="Search">
                <div class="input-group-btn">
                  <button class="btn btn-sm btn-default" type="submit"><i class="fa fa-search"></i></button>
                </div>
              </div>
            </div>
          </div><!-- /.box-header -->
          </form>
          <div class="box-body table-responsive no-padding">
            <table class="table table-hover">
              <tr>
                <th  width="100px"><input name="deptState" type="checkbox" class="minimal checkbox-toolbar"> 行号</th>
                <th>部门名称</th>
                <th>描述</th>
                <th width="120px">操作</th>
              </tr>
              <#list pageData.getRecords() as dept>
              	  <tr>
	                <td>
	                   <label>
	                	<input type="checkbox" class="minimal checkbox-item">
	                	${((pageData.current-1)*pageData.size +dept_index+1)!}
	                	</label>
	                </td>
	                <td>${(dept.deptName)!}</td>
	                <td>${(dept.deptDesc)!'--'}</td>
	                <td>
	                	<#if permissions?seq_contains('editDept')>
	                	<a class="btn btn-primary btn-xs" href="/system/dept/edit/${(dept.id)!}.html">编辑</a>
	                	<#else>-</#if>
	                	<#if permissions?seq_contains('deleteDept')>
	                	<a class="btn btn-danger btn-xs"
	                	 data-tiggle="ajax"
	                	 data-submit-url="/system/dept/delete?id=${(dept.id)!}"
	                	 data-confirm="您确定要删除该条记录吗?">删除</a>
	                	 <#else>-</#if>
	                </td>
	              </tr>
              </#list>
            </table>
          </div><!-- /.box-body -->
          <div class="box-footer">
            <div class="col-xs-6">显示 ${((pageData.current -1) * pageData.size + 1)!}  -  ${(pageData.current * pageData.size)!} 条  共 ${(pageData.getTotal())!} 条记录</div>
            <div class="col-xs-6">
	             <#include "/common/paginate.html" />
	  			 <@paginate currentPage=pageData.getCurrent() totalPage=pageData.getPages() actionUrl="/system/dept/list/" urlParas=".html?search=${search!}"  />
            </div>
          </div>
        </div><!-- /.box -->
      </div>
    </div>
  </section><!-- /.content -->
</div><!-- /.content-wrapper -->
</@body>
<@footer>
</@footer>